import { SortEnum, FlagEnum, OperatorEnum } from '../enums/index';

/**
 * 分页查询
 */
export interface IPageQuery<T> {
  currentPage?: number;
  pageSize?: number;
  t?: T;
  orders?: IPageQueryOrders[];
  flag?: FlagEnum | string;
  query?: IPageFuzzyQuery[];
  /* 是否分页 */
  all?: boolean;
}

/**
 * 排序
 */
export interface IPageQueryOrders {
  key: string;
  sort?: SortEnum | string;
}

/**
 * 自定义查询
 */
export interface IPageFuzzyQuery {
  key: string;
  value: string;
  operator: OperatorEnum | string;
  flag?: FlagEnum | string;
}
